<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/1/17
 * Time: 15:16
 */
namespace app\tour\controller;

use think\Db;
use think\Request;
use app\tour\model\Album as AlbumModel;
use app\tour\model\Tour as TourModel;
use think\Session;
class Notice extends Common
{
    public function notice()
    {
        $tour = Db::name('tours')->field('in_tour_time,city,address')->where('tour_id',Session::get('tour_id'))->find();
        $this->assign('tour',$tour);
        return view();
    }

    public function editTourInfo()
    {
        if (Request::instance()->isAjax()){

            $post = Request::instance()->post();
            $post = $post['data'];
            $eidtData = [

                'in_tour_time'    => $post['in_tour_time'],

            ];

            $res = Db::name('tours')->where('tour_id',Session::get('tour_id'))->update($eidtData);

            if ($res !== false){

                return ['code'=>0];

            }else{

                return ['code'=>1];

            }

        }
    }
}